package com.hon2;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class CalendarTest {
    public static void main(String[] args) {
     Calendar cal = Calendar.getInstance();
     int year = cal.get(Calendar.YEAR);
        System.out.println(year);
    int month = cal.get(Calendar.MONTH);
        System.out.println(month);
    int week = cal.get(Calendar.WEEK_OF_YEAR);
        System.out.println(week);
        cal.add(Calendar.HOUR,-10000);
        Date date = cal.getTime();
        SimpleDateFormat sdf = new SimpleDateFormat("YYYY-MM-dd HH:mm;ss");
        String str = sdf.format(date);
        System.out.println(str);
    }
}
